package com.project.controller;

import com.project.bean.CutPageBean;
import com.project.bean.OrderBean;
import com.project.bean.StudentBean;
import com.project.service.IOrderService;
import com.project.service.imp.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("user")
public class UserController {
    @RequestMapping("checkName")
    public String checkName(String userName) {
        if ("java".equals(userName)) {
            return "ok";
        } else {
            return "no";
        }
    }

    @RequestMapping("getList")
    public List<StudentBean> getList() {
        List<StudentBean> list = new ArrayList<>();
        list.add(new StudentBean(12, "张三", LocalDate.parse("1999-02-25")));
        list.add(new StudentBean(1, "张四", LocalDate.parse("1999-02-25")));
        list.add(new StudentBean(4, "张五", LocalDate.parse("1999-02-25")));

        return list;
    }
}
